//
//  Message.swift
//  swiftUIdemo
//
//  Created by Z.cy on 2025/1/8.
//

import Foundation
struct Message: Identifiable {
    var id :UUID
    var content: String
    var user:User?
    var  isCurrentUser: Bool{
        user == nil
    }
    init(id: UUID = UUID(), content: String, user: User? = nil) {
        self.id = id
        self.content = content
        self.user = user
    }
    
}
extension Message {
    static let messageSent = Message(content: "嗨，你好呀")
    static let messageReceived = Message(content: "我很好",user: User.Other1)
}


